Integrand size = 13, antiderivative size = 53 \[ \int \frac {\csc ^2(x)}{a+b \csc (x)} \, dx=-\frac {\text {arctanh}(\cos (x))}{b}+\frac {2 a \text {arctanh}\left (\frac {a+b \tan \left (\frac {x}{2}\right )}{\sqrt {a^2-b^2}}\right )}{b \sqrt {a^2-b^2}} \]
[Out]
Time = 0.12 (sec) , antiderivative size = 53, normalized size of antiderivative = 1.00, number of steps used = 6, number of rules used = 6, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.462, Rules used = {3874, 3855, 3916, 2739, 632, 212} \[ \int \frac {\csc ^2(x)}{a+b \csc (x)} \, dx=\frac {2 a \text {arctanh}\left (\frac {a+b \tan \left (\frac {x}{2}\right )}{\sqrt {a^2-b^2}}\right )}{b \sqrt {a^2-b^2}}-\frac {\text {arctanh}(\cos (x))}{b} \]
[In]
[Out]
Rule 212
Rule 632
Rule 2739
Rule 3855
Rule 3874
Rule 3916
Rubi steps \begin{align*} \text {integral}& = \frac {\int \csc (x) \, dx}{b}-\frac {a \int \frac {\csc (x)}{a+b \csc (x)} \, dx}{b} \\ & = -\frac {\text {arctanh}(\cos (x))}{b}-\frac {a \int \frac {1}{1+\frac {a \sin (x)}{b}} \, dx}{b^2} \\ & = -\frac {\text {arctanh}(\cos (x))}{b}-\frac {(2 a) \text {Subst}\left (\int \frac {1}{1+\frac {2 a x}{b}+x^2} \, dx,x,\tan \left (\frac {x}{2}\right )\right )}{b^2} \\ & = -\frac {\text {arctanh}(\cos (x))}{b}+\frac {(4 a) \text {Subst}\left (\int \frac {1}{-4 \left (1-\frac {a^2}{b^2}\right )-x^2} \, dx,x,\frac {2 a}{b}+2 \tan \left (\frac {x}{2}\right )\right )}{b^2} \\ & = -\frac {\text {arctanh}(\cos (x))}{b}+\frac {2 a \text {arctanh}\left (\frac {b \left (\frac {a}{b}+\tan \left (\frac {x}{2}\right )\right )}{\sqrt {a^2-b^2}}\right )}{b \sqrt {a^2-b^2}} \\ \end{align*}
Time = 0.14 (sec) , antiderivative size = 62, normalized size of antiderivative = 1.17 \[ \int \frac {\csc ^2(x)}{a+b \csc (x)} \, dx=\frac {-\frac {2 a \arctan \left (\frac {a+b \tan \left (\frac {x}{2}\right )}{\sqrt {-a^2+b^2}}\right )}{\sqrt {-a^2+b^2}}-\log \left (\cos \left (\frac {x}{2}\right )\right )+\log \left (\sin \left (\frac {x}{2}\right )\right )}{b} \]
[In]
[Out]
Time = 0.35 (sec) , antiderivative size = 53, normalized size of antiderivative = 1.00
method | result | size |
default | \(-\frac {2 a \arctan \left (\frac {2 b \tan \left (\frac {x}{2}\right )+2 a}{2 \sqrt {-a^{2}+b^{2}}}\right )}{b \sqrt {-a^{2}+b^{2}}}+\frac {\ln \left (\tan \left (\frac {x}{2}\right )\right )}{b}\) | \(53\) |
risch | \(-\frac {a \ln \left ({\mathrm e}^{i x}+\frac {i b \sqrt {a^{2}-b^{2}}-a^{2}+b^{2}}{\sqrt {a^{2}-b^{2}}\, a}\right )}{\sqrt {a^{2}-b^{2}}\, b}+\frac {a \ln \left ({\mathrm e}^{i x}+\frac {i b \sqrt {a^{2}-b^{2}}+a^{2}-b^{2}}{\sqrt {a^{2}-b^{2}}\, a}\right )}{\sqrt {a^{2}-b^{2}}\, b}-\frac {\ln \left ({\mathrm e}^{i x}+1\right )}{b}+\frac {\ln \left ({\mathrm e}^{i x}-1\right )}{b}\) | \(152\) |
[In]
[Out]
Leaf count of result is larger than twice the leaf count of optimal. 100 vs. \(2 (47) = 94\).
Time = 0.29 (sec) , antiderivative size = 245, normalized size of antiderivative = 4.62 \[ \int \frac {\csc ^2(x)}{a+b \csc (x)} \, dx=\left [\frac {\sqrt {a^{2} - b^{2}} a \log \left (\frac {{\left (a^{2} - 2 \, b^{2}\right )} \cos \left (x\right )^{2} + 2 \, a b \sin \left (x\right ) + a^{2} + b^{2} + 2 \, {\left (b \cos \left (x\right ) \sin \left (x\right ) + a \cos \left (x\right )\right )} \sqrt {a^{2} - b^{2}}}{a^{2} \cos \left (x\right )^{2} - 2 \, a b \sin \left (x\right ) - a^{2} - b^{2}}\right ) - {\left (a^{2} - b^{2}\right )} \log \left (\frac {1}{2} \, \cos \left (x\right ) + \frac {1}{2}\right ) + {\left (a^{2} - b^{2}\right )} \log \left (-\frac {1}{2} \, \cos \left (x\right ) + \frac {1}{2}\right )}{2 \, {\left (a^{2} b - b^{3}\right )}}, \frac {2 \, \sqrt {-a^{2} + b^{2}} a \arctan \left (-\frac {\sqrt {-a^{2} + b^{2}} {\left (b \sin \left (x\right ) + a\right )}}{{\left (a^{2} - b^{2}\right )} \cos \left (x\right )}\right ) - {\left (a^{2} - b^{2}\right )} \log \left (\frac {1}{2} \, \cos \left (x\right ) + \frac {1}{2}\right ) + {\left (a^{2} - b^{2}\right )} \log \left (-\frac {1}{2} \, \cos \left (x\right ) + \frac {1}{2}\right )}{2 \, {\left (a^{2} b - b^{3}\right )}}\right ] \]
[In]
[Out]
\[ \int \frac {\csc ^2(x)}{a+b \csc (x)} \, dx=\int \frac {\csc ^{2}{\left (x \right )}}{a + b \csc {\left (x \right )}}\, dx \]
[In]
[Out]
Exception generated. \[ \int \frac {\csc ^2(x)}{a+b \csc (x)} \, dx=\text {Exception raised: ValueError} \]
[In]
[Out]
none
Time = 0.28 (sec) , antiderivative size = 63, normalized size of antiderivative = 1.19 \[ \int \frac {\csc ^2(x)}{a+b \csc (x)} \, dx=-\frac {2 \, {\left (\pi \left \lfloor \frac {x}{2 \, \pi } + \frac {1}{2} \right \rfloor \mathrm {sgn}\left (b\right ) + \arctan \left (\frac {b \tan \left (\frac {1}{2} \, x\right ) + a}{\sqrt {-a^{2} + b^{2}}}\right )\right )} a}{\sqrt {-a^{2} + b^{2}} b} + \frac {\log \left ({\left | \tan \left (\frac {1}{2} \, x\right ) \right |}\right )}{b} \]
[In]
[Out]
Time = 18.29 (sec) , antiderivative size = 129, normalized size of antiderivative = 2.43 \[ \int \frac {\csc ^2(x)}{a+b \csc (x)} \, dx=\frac {\ln \left (\frac {\sin \left (\frac {x}{2}\right )}{\cos \left (\frac {x}{2}\right )}\right )}{b}-\frac {2\,a\,\mathrm {atanh}\left (\frac {\sqrt {a^2-b^2}\,\left (4{}\mathrm {i}\,\sin \left (\frac {x}{2}\right )\,a^2+2{}\mathrm {i}\,\cos \left (\frac {x}{2}\right )\,a\,b-1{}\mathrm {i}\,\sin \left (\frac {x}{2}\right )\,b^2\right )}{a^3\,\sin \left (\frac {x}{2}\right )\,4{}\mathrm {i}+b\,\cos \left (\frac {x}{2}\right )\,\left (a^2-b^2\right )\,1{}\mathrm {i}+a^2\,b\,\cos \left (\frac {x}{2}\right )\,1{}\mathrm {i}-a\,b^2\,\sin \left (\frac {x}{2}\right )\,3{}\mathrm {i}}\right )}{b\,\sqrt {a^2-b^2}} \]
[In]
[Out]